<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
<%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>


<html>
<f:view>
<a4j:loadStyle src="/styles/jlc.css"></a4j:loadStyle>
<body>
<center>
<h:outputText escape="false" value="<u><h1>JAVA LEARNING CENTER</h1></u>"
style="color:red">
</h:outputText>

<a4j:form id="listForm" rendered="#{studentListBean.flag}">
<a4j:commandButton value="get Student Details"
action="#{studentListBean.getStudents}"
reRender="listForm,slist">
</a4j:commandButton>
</a4j:form>


<h:outputText escape="false" value="<u><b>Student Details</b></u>" rendered="#{!
studentListBean.flag}"></h:outputText>

<h:form>
<a4j:keepAlive beanName="studentListBean"></a4j:keepAlive>
<rich:datascroller align="center" for="slist" maxPages="10" fastStep="2"
id="ds" reRender="ds" rendered="#{!studentListBean.flag}"/>

<rich:dataTable width="483" id="slist" rows="3"
value="#{studentListBean.studentList}" var="student" rendered="#{!
studentListBean.flag}">

<rich:column sortable="false">
<f:facet name="header"><h:outputText value="Name"/></f:facet>
<h:outputText value="#{student.name}"/>
</rich:column>

<rich:column sortable="true" sortExpression="#{student.batchId}">
<f:facet name="header"><h:outputText value="Batch"/></f:facet>
<h:outputText value="#{student.batchId}" />
</rich:column>



<rich:column sortable="false">
<f:facet name="header"><h:outputText value="Branch"/></f:facet>
<h:outputText value="#{student.branch}" />
</rich:column>



<rich:column sortable="false">
<f:facet name="header"><h:outputText value="Email"/></f:facet>
<h:outputText value="#{student.email}" />
</rich:column>

<rich:column sortable="false">
<f:facet name="header"><h:outputText value="Phone"/></f:facet>
<h:outputText value="#{student.phone}" />
</rich:column>

</rich:dataTable>
</h:form>
</center>
</body>
</f:view>
</html>